package com.britoso.morerecent;

import java.util.HashMap;

import android.app.Application;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
import android.util.Log;

/**
 * Cache data from previous runs.
 * @author britoso
 *
 */
public class RecentData extends Application
{
	//key for all three is the full classpath of the activity
	private HashMap<String, Drawable> iconMap;
	private HashMap<String, String> titleMap;
	private HashMap<String, ResolveInfo> activityInfoMap;// resolved activity

	public HashMap<String, Drawable> getIconMap()
	{
		return iconMap;
	}

	public void setIconMap(HashMap<String, Drawable> iconMap)
	{
		this.iconMap = iconMap;
	}

	public HashMap<String, String> getTitleMap()
	{
		return titleMap;
	}

	public void setTitleMap(HashMap<String, String> titleMap)
	{
		this.titleMap = titleMap;
	}

	public HashMap<String, ResolveInfo> getActivityInfoMap()
	{
		return activityInfoMap;
	}

	public void setActivityInfoMap(HashMap<String, ResolveInfo> activityInfoMap)
	{
		this.activityInfoMap = activityInfoMap;
	}

	public void init(boolean debug)
	{
		if (activityInfoMap == null) activityInfoMap = new HashMap<String, ResolveInfo>(45);
		if (titleMap == null) titleMap = new HashMap<String, String>(45);
		if (iconMap == null) iconMap = new HashMap<String, Drawable>(45);
		int im, tm, am;
		im = iconMap.size();
		tm = titleMap.size();
		am = activityInfoMap.size();
		if (debug)
			Log.i(RecentData.class.getName(), "Sizes. iconMap=" + im + " titleMap=" + tm + " activityInfoMap=" + am);

	}

}